import java.util.ArrayList;


public class Client {
	private String nom;
	private String prenom;
	private int age;
	private String email;
	private ArrayList<Commande> commandes;
	
	public Client(){
		this.nom = "";
		this.prenom = "";
		this.age = 0;
		this.email = "";
		this.commandes = new ArrayList<Commande>();
	}
	
	public Client(String nom, String prenom, int age, String email) {
		if(nom=="" || prenom=="" || age<0 || !email.contains("@")){
			System.err.println("Arguments invalides");
		}
		else{
			this.nom = nom;
			this.prenom = prenom;
			this.age = age;
			this.email = email;
		}
		this.commandes = new ArrayList<Commande>();
	}
	
	public String getNom() {
		return nom;
	}
	public void setNom(String nom) {
		if (nom !="")
			this.nom = nom;
		else{
			System.err.println("Nom invalide");
		}
			
	}
	public String getPrenom() {
		return prenom;
	}
	public void setPrenom(String prenom) {
		if (prenom !="")
			this.prenom = prenom;
		else{
			System.err.println("Prenom invalide");
		}
	}
	
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		if (age > 0)
			this.age = age;
		else{
			System.err.println("Age invalide");
		}
	}
	
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		if (email.contains("@"))
			this.email = email;
		else{
			System.err.println("Email invalide");
		}
	}
	
	public ArrayList<Commande> getCommandes() {
		return commandes;
	}
	public void setCommandes(Commande c) {
		this.commandes.add(c);
	}
	
	
}
